import {createRouter,createWebHistory} from 'vue-router'
import PhoneProduct from '@/view/phone/PhoneProduct.vue'
import PhoneMine from '@/view/phone/PhoneMine.vue'
import PhoneHome from '@/view/phone/PhoneHome.vue'
import PhoneForum from '@/view/phone/PhoneForum.vue'
import RobotCompare from "@/view/phone/RobotCompare.vue";
import PhoneView from "@/components/phone/PhoneView.vue";
import PhoneRate from "@/view/phone/PhoneRate.vue";
import PhoneFeedback from "@/view/phone/PhoneFeedback.vue";
import CompareLayout from "@/layouts/CompareLayout.vue";
import RateLayout from "@/layouts/RateLayout.vue";
import FeedbackLayout from "@/layouts/FeedbackLayout.vue";

const routes = [
    {
        path: '/',
        component: PhoneView,
        meta: { hideAi: false },
        children: [
            { path: '', name: 'PhoneHome', component: PhoneHome,},
            { path: 'forum', name: 'PhoneForum', component: PhoneForum },
            { path: 'robot', name: 'PhoneProduct', component: PhoneProduct },
            { path: 'profile', name: 'PhoneMine', component: PhoneMine }
        ]
    },
    {
        path: '/compare',
        component: CompareLayout, // 让 /compare 使用不同的布局
        meta: { hideTabBar: true },
        children: [
            { path: '', name: 'RobotCompare', component: RobotCompare }
        ]
    },
    {
        path: '/rate',
        component: RateLayout, // 让 /compare 使用不同的布局
        meta: { hideTabBar: true },
        children: [
            { path: '', name: 'PhoneRate', component: PhoneRate }
        ]
    }
    ,
    {
        path: '/feedback',
        component: FeedbackLayout, // 让 /compare 使用不同的布局
        meta: { hideTabBar: true },
        children: [
            { path: '', name: 'PhoneFeedback', component: PhoneFeedback }
        ]
    }
];

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes
});
export default router